package site.jlopen.secret.common;

import java.io.Serializable;

import site.jlopen.secret.client.SecretClientHttpErrorCode;

/**
* @ClassName: ClientResponse
* @Description: 通用返回类
* @author 码农小鹿  
* @date 2023年8月31日 上午10:10:45
* @param <T>
 */
public class SecretClientResponse<T> implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 6629683622768530715L;

	private SecretClientHttpErrorCode status;
	
	private String msg;
	
	private T data;

    public SecretClientResponse(SecretClientHttpErrorCode status, String msg, T data) {
        this.status = status;
        this.data = data;
        this.msg = msg;
    }

    public SecretClientResponse(SecretClientHttpErrorCode status, T data) {
        this(status, "", data);
    }

    public SecretClientResponse(SecretClientHttpErrorCode status, String msg) {
        this(status, msg, null);
    }

    public SecretClientResponse(SecretClientHttpErrorCode errorCode) {
        this(errorCode, errorCode.getDesc(), null);
    }

	public SecretClientHttpErrorCode getStatus() {
		return status;
	}

	public void setStatus(SecretClientHttpErrorCode status) {
		this.status = status;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "ClientResponse [status=" + status + ", msg=" + msg + ", data=" + data + "]";
	}

}
